// eslint-disable-next-line @typescript-eslint/no-var-requires

const path = require('path')

const resolve = (dir) => {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: './',
  lintOnSave: true,
  chainWebpack: (config) => {
    config.resolve.alias.set('@', resolve('src')).set('_c', resolve('src/components'))
  },
  css: {
    loaderOptions: {
      sass: {
        prependData: `@import "@/assets/styles/var.scss";`
      }
    }
  },
  // 设为false打包时不生成.map文件
  productionSourceMap: false,
  devServer: {
    host: '0.0.0.0',
    port: '8080',
    proxy: {
      '/bigdata/': {
        target: 'http://bigdata.jsyixin.com',
        changeOrigin: true,
        pathRewrite: {
          '^/bigdata': ''
        }
      }
    }
  }
}
